#define _CRT_SECURE_NO_WARNINGS 1

#include "string.h"
#include "shared_ptr.h"

template<class T>
struct DeleteArray
{
	void operator()(T* ptr)
	{
		delete[] ptr;
	}
};

struct ListNode
{
	int _val;
	//struct ListNode* _next;
	//struct ListNode* _prev;

	//bit::shared_ptr<ListNode> _next;
	//bit::shared_ptr<ListNode> _prev;

	ListNode(int val = 0)
		:_val(val)
	{}

	~ListNode()
	{
		cout << "~ListNode()" << endl;
	}
};

int main()
{
	//gm::shared_ptr<ListNode> p2(new ListNode[10], DeleteArray<ListNode>());
	DeleteArray<ListNode> d1;
	gm::shared_ptr<ListNode> p2(new ListNode[10], std::bind(&DeleteArray<ListNode>::operator(),&d1, std::placeholders::_1));
	return 0;
}